package com.yoda.mall.model.vo;

import com.yoda.mall.model.entity.pms.Product;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * @author shawn
 * @date 2022年 12月 16日 15:30
 */
@Data
public class ProductVo {
    private Long id;
    private Long productId;
    private String productName;
    private Integer recommendStatus;
    private Integer sort;

    public static ProductVo init(Product product){
        ProductVo vo = new ProductVo();
        BeanUtils.copyProperties(product,vo);
        vo.setProductName(product.getName());
        vo.setRecommendStatus(product.getRecommandStatus());
        return vo;
    }
}
